package me.zhao.subscribe.weatherSubscribe;

public class Client {
	public static void main(String[] args) {
		//1.创建目标
		ConcreateWeatherSubject weatherSubj = new ConcreateWeatherSubject();
		
		//2.创建观察者
		ConcreateObserver observerGirl = new ConcreateObserver();
		observerGirl.setObserverName("小明女友");
		observerGirl.setRemindThing("新川中央公园，不见不散！");
		
		ConcreateObserver observerMom = new ConcreateObserver();
		observerMom.setObserverName("小明妈妈");
		observerMom.setRemindThing("明天天气晴朗，可以出外活动！");
		
		//3.注册观察者
		weatherSubj.attach(observerGirl);
		weatherSubj.attach(observerMom);
		
		//4.目标发送天气
		weatherSubj.setWeatherContent("明天天气晴朗，气温28度。");
	}
}
